Skip to content

feat(runtime): add shared runtime#1602

Open
VianneyRuhlmann wants to merge 36 commits intomainfrom
vianney/implement-shared-runtime
Open

feat(runtime): add shared runtime#1602
VianneyRuhlmann wants to merge 36 commits intomainfrom
vianney/implement-shared-runtime

Conversation

@VianneyRuhlmann
Copy link
Contributor

@VianneyRuhlmann VianneyRuhlmann commented Feb 18, 2026

What does this PR do?

Implementing the shared runtime

This PR introduces a shared runtime to be used across common components it offers two main features:

  • Provide access to a tokio runtime to call async code in blocking functions e.g. TraceExporter::send
  • Spawn background workers on the runtime which can be paused and restarted on forks
    The shared runtime runs the workers using the PausableWorker

Update to the Worker trait

This PR also refactors the Worker trait to make it execute a trigger-run loop. The worker can be paused between two calls to run but not within a run execution. This is the same tradeoff between fork-time impact and worker execution than the one in dd-trace-py. Some extra hooks where introduced to allow porting the existing workers to this new lifecycle (e.g. initial_trigger, shutdown).

Expose ffi

The shared runtime FFI exposes an pointer to the SharedRuntime which is wrapped in an Arc. The pointer used by the users is pointing directly at the runtime and the Arc is only materialized when the pointer is dropped.

Porting the existing workers

The update to the worker trait needs to be applied to existing workers (stats exporter, info fetcher, telemetry)

Stats exporter

The stats exporter doesn't need the cancellation token anymore as the flushing of remaining stats is handled in the shutdown hook. The trace exporter can trigger the flush by stopping the worker with the handle

Info fetcher

The info fetcher uses the on_pause hook to release the reference to the IoStack. This used to be done by the TraceExporter stop_worker but is now handled directly in the worker.

Telemetry worker

The telemetry worker required some refactor to fit in the new Worker trait. The main issue is that the trigger needs to save the next action to be used in the run function. This could be done by passing the return value of trigger to run but I'm not sure this will be a common pattern in workers. If this turns out to be we can reconsider it.

Losing telemetry payloads on shutdown

Currently when the telemetry worker is shut down all actions sent before the stop action are processed. With this refactor it's no longer the cases as the shutdown hook bypasses the actions queued. This is deemed acceptable since there's currently no way to know if an action has been posted before or after the stop, this means any action is already at risk of being ignored.

Using the shared runtime in TraceExporter

This PR also integrates the shared runtime in the Trace Exporter. We can now pass a SharedRuntime to the TraceExporter and the workers will be spawned on it. Fork hooks from the TraceExporter are removed as this is now handled by the SharedRuntime. The TraceExporter also uses the shared runtime to block on async code.

Motivation

Be able to share a common tokio runtime across components and manage fork-safety in a single place.

Additional Notes

This PR is a breaking change especially for language which register "fork-safety" hooks as this should now be handled in the SharedRuntime.

How to test the change?

Describe here in detail how the change can be validated.

@pr-commenter
Copy link

pr-commenter bot commented Feb 18, 2026

Benchmarks

Comparison

Benchmark execution time: 2026-03-13 13:14:49

Comparing candidate commit 7bac719 in PR branch vianney/implement-shared-runtime with baseline commit 892b7bf in branch main.

Found 7 performance improvements and 12 performance regressions! Performance is the same for 39 metrics, 2 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:concentrator/add_spans_to_concentrator

  • 🟩 execution_time [-2.383ms; -2.376ms] or [-18.269%; -18.215%]

scenario:credit_card/is_card_number/ 378282246310005

  • 🟥 execution_time [+5.496µs; +5.579µs] or [+8.093%; +8.215%]
  • 🟥 throughput [-1117666.891op/s; -1102202.020op/s] or [-7.590%; -7.485%]

scenario:credit_card/is_card_number/378282246310005

  • 🟥 execution_time [+5.456µs; +5.528µs] or [+8.431%; +8.541%]
  • 🟥 throughput [-1215832.594op/s; -1201333.035op/s] or [-7.868%; -7.775%]

scenario:credit_card/is_card_number/37828224631000521389798

  • 🟥 execution_time [+6.528µs; +6.555µs] or [+14.301%; +14.361%]
  • 🟥 throughput [-2752663.389op/s; -2739763.709op/s] or [-12.565%; -12.506%]

scenario:credit_card/is_card_number/x371413321323331

  • 🟩 execution_time [-773.910ns; -756.201ns] or [-11.670%; -11.403%]
  • 🟩 throughput [+19429370.675op/s; +19942516.811op/s] or [+12.884%; +13.225%]

scenario:credit_card/is_card_number_no_luhn/ 378282246310005

  • 🟥 execution_time [+4.107µs; +4.139µs] or [+7.685%; +7.745%]
  • 🟥 throughput [-1345113.053op/s; -1335278.661op/s] or [-7.188%; -7.136%]

scenario:credit_card/is_card_number_no_luhn/378282246310005

  • 🟥 execution_time [+4.585µs; +4.648µs] or [+9.131%; +9.255%]
  • 🟥 throughput [-1686716.115op/s; -1665912.969op/s] or [-8.470%; -8.365%]

scenario:credit_card/is_card_number_no_luhn/37828224631000521389798

  • 🟥 execution_time [+6.560µs; +6.584µs] or [+14.376%; +14.429%]
  • 🟥 throughput [-2764644.405op/s; -2753451.207op/s] or [-12.615%; -12.564%]

scenario:credit_card/is_card_number_no_luhn/x371413321323331

  • 🟩 execution_time [-778.513ns; -757.728ns] or [-11.744%; -11.430%]
  • 🟩 throughput [+19495297.526op/s; +20096772.237op/s] or [+12.924%; +13.322%]

scenario:single_flag_killswitch/rules-based

  • 🟩 execution_time [-9.955ns; -9.210ns] or [-4.933%; -4.564%]

scenario:sql/obfuscate_sql_string

  • 🟩 execution_time [-4.313µs; -4.231µs] or [-4.797%; -4.706%]

Candidate

Candidate benchmark details

Group 1

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 7bac719 1773406731 vianney/implement-shared-runtime
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
write only interface execution_time 1.255µs 3.222µs ± 1.425µs 3.012µs ± 0.025µs 3.040µs 3.686µs 13.838µs 15.169µs 403.57% 7.357 55.435 44.12% 0.101µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
write only interface execution_time [3.024µs; 3.419µs] or [-6.131%; +6.131%] None None None

Group 2

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 7bac719 1773406731 vianney/implement-shared-runtime
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
profile_add_sample_frames_x1000 execution_time 4.168ms 4.174ms ± 0.008ms 4.173ms ± 0.001ms 4.174ms 4.178ms 4.181ms 4.283ms 2.63% 12.112 159.049 0.19% 0.001ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
profile_add_sample_frames_x1000 execution_time [4.173ms; 4.175ms] or [-0.027%; +0.027%] None None None

Group 3

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 7bac719 1773406731 vianney/implement-shared-runtime
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
redis/obfuscate_redis_string execution_time 33.566µs 34.049µs ± 0.843µs 33.673µs ± 0.046µs 33.729µs 35.788µs 35.858µs 37.812µs 12.29% 1.853 2.117 2.47% 0.060µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
redis/obfuscate_redis_string execution_time [33.932µs; 34.166µs] or [-0.343%; +0.343%] None None None

Group 4

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 7bac719 1773406731 vianney/implement-shared-runtime
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
ip_address/quantize_peer_ip_address_benchmark execution_time 5.020µs 5.087µs ± 0.048µs 5.097µs ± 0.033µs 5.112µs 5.198µs 5.204µs 5.206µs 2.13% 0.777 0.206 0.94% 0.003µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
ip_address/quantize_peer_ip_address_benchmark execution_time [5.080µs; 5.094µs] or [-0.131%; +0.131%] None None None

Group 5

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 7bac719 1773406731 vianney/implement-shared-runtime
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
benching string interning on wordpress profile execution_time 160.746µs 161.312µs ± 0.357µs 161.264µs ± 0.136µs 161.384µs 161.864µs 162.273µs 164.455µs 1.98% 4.003 29.438 0.22% 0.025µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching string interning on wordpress profile execution_time [161.263µs; 161.362µs] or [-0.031%; +0.031%] None None None

Group 6

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 7bac719 1773406731 vianney/implement-shared-runtime
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
benching deserializing traces from msgpack to their internal representation execution_time 49.782ms 50.273ms ± 1.255ms 50.116ms ± 0.080ms 50.217ms 50.346ms 58.087ms 61.791ms 23.30% 7.999 64.501 2.49% 0.089ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching deserializing traces from msgpack to their internal representation execution_time [50.099ms; 50.446ms] or [-0.346%; +0.346%] None None None

Group 7

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 7bac719 1773406731 vianney/implement-shared-runtime
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_trace/test_trace execution_time 251.043ns 259.558ns ± 10.639ns 254.484ns ± 1.424ns 259.336ns 285.167ns 286.779ns 287.682ns 13.04% 1.714 1.371 4.09% 0.752ns 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_trace/test_trace execution_time [258.083ns; 261.032ns] or [-0.568%; +0.568%] None None None

Group 8

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 7bac719 1773406731 vianney/implement-shared-runtime
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
tags/replace_trace_tags execution_time 2.424µs 2.451µs ± 0.021µs 2.446µs ± 0.007µs 2.454µs 2.496µs 2.503µs 2.558µs 4.58% 1.592 3.110 0.86% 0.001µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
tags/replace_trace_tags execution_time [2.448µs; 2.454µs] or [-0.119%; +0.119%] None None None

Group 9

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 7bac719 1773406731 vianney/implement-shared-runtime
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
concentrator/add_spans_to_concentrator execution_time 10.626ms 10.666ms ± 0.017ms 10.667ms ± 0.012ms 10.678ms 10.695ms 10.703ms 10.716ms 0.46% 0.081 -0.175 0.16% 0.001ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
concentrator/add_spans_to_concentrator execution_time [10.664ms; 10.669ms] or [-0.022%; +0.022%] None None None

Group 10

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 7bac719 1773406731 vianney/implement-shared-runtime
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... execution_time 205.986µs 206.532µs ± 0.368µs 206.464µs ± 0.209µs 206.699µs 207.263µs 207.742µs 208.297µs 0.89% 1.597 3.696 0.18% 0.026µs 1 200
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput 4800829.168op/s 4841877.901op/s ± 8605.493op/s 4843450.199op/s ± 4908.977op/s 4848001.716op/s 4851748.818op/s 4853916.917op/s 4854698.863op/s 0.23% -1.581 3.616 0.18% 608.500op/s 1 200
normalization/normalize_name/normalize_name/bad-name execution_time 18.561µs 18.675µs ± 0.112µs 18.661µs ± 0.039µs 18.699µs 18.834µs 19.032µs 19.481µs 4.39% 3.595 20.746 0.60% 0.008µs 1 200
normalization/normalize_name/normalize_name/bad-name throughput 51332848.716op/s 53548085.437op/s ± 315693.232op/s 53587562.422op/s ± 113088.703op/s 53715905.923op/s 53868939.108op/s 53872024.113op/s 53875644.967op/s 0.54% -3.423 19.166 0.59% 22322.883op/s 1 200
normalization/normalize_name/normalize_name/good execution_time 10.673µs 10.787µs ± 0.043µs 10.786µs ± 0.027µs 10.812µs 10.860µs 10.899µs 10.964µs 1.65% 0.511 1.429 0.39% 0.003µs 1 200
normalization/normalize_name/normalize_name/good throughput 91209938.123op/s 92708642.572op/s ± 364793.344op/s 92711299.499op/s ± 229077.757op/s 92944402.486op/s 93284289.701op/s 93472489.323op/s 93691018.464op/s 1.06% -0.474 1.343 0.39% 25794.785op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... execution_time [206.481µs; 206.583µs] or [-0.025%; +0.025%] None None None
normalization/normalize_name/normalize_name/Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Long-.Too-Lo... throughput [4840685.262op/s; 4843070.539op/s] or [-0.025%; +0.025%] None None None
normalization/normalize_name/normalize_name/bad-name execution_time [18.660µs; 18.691µs] or [-0.083%; +0.083%] None None None
normalization/normalize_name/normalize_name/bad-name throughput [53504333.391op/s; 53591837.483op/s] or [-0.082%; +0.082%] None None None
normalization/normalize_name/normalize_name/good execution_time [10.781µs; 10.793µs] or [-0.055%; +0.055%] None None None
normalization/normalize_name/normalize_name/good throughput [92658085.723op/s; 92759199.421op/s] or [-0.055%; +0.055%] None None None

Group 11

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 7bac719 1773406731 vianney/implement-shared-runtime
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
credit_card/is_card_number/ execution_time 3.890µs 3.912µs ± 0.007µs 3.911µs ± 0.001µs 3.913µs 3.918µs 3.922µs 3.978µs 1.70% 6.764 59.301 0.18% 0.000µs 1 200
credit_card/is_card_number/ throughput 251403843.587op/s 255595861.222op/s ± 445737.973op/s 255671536.896op/s ± 79894.166op/s 255744994.631op/s 255832485.219op/s 255926658.949op/s 257096869.393op/s 0.56% -6.682 58.435 0.17% 31518.434op/s 1 200
credit_card/is_card_number/ 3782-8224-6310-005 execution_time 79.438µs 80.022µs ± 0.338µs 79.972µs ± 0.233µs 80.231µs 80.646µs 80.864µs 80.907µs 1.17% 0.610 -0.271 0.42% 0.024µs 1 200
credit_card/is_card_number/ 3782-8224-6310-005 throughput 12359866.308op/s 12496720.614op/s ± 52584.205op/s 12504332.775op/s ± 36512.131op/s 12537506.578op/s 12570566.510op/s 12583255.375op/s 12588499.670op/s 0.67% -0.593 -0.296 0.42% 3718.265op/s 1 200
credit_card/is_card_number/ 378282246310005 execution_time 72.624µs 73.447µs ± 0.293µs 73.427µs ± 0.194µs 73.658µs 73.943µs 74.179µs 74.339µs 1.24% 0.300 0.133 0.40% 0.021µs 1 200
credit_card/is_card_number/ 378282246310005 throughput 13451869.360op/s 13615496.854op/s ± 54226.310op/s 13618924.260op/s ± 35899.221op/s 13651109.070op/s 13691873.245op/s 13730067.927op/s 13769625.260op/s 1.11% -0.276 0.117 0.40% 3834.379op/s 1 200
credit_card/is_card_number/37828224631 execution_time 3.895µs 3.912µs ± 0.003µs 3.912µs ± 0.001µs 3.913µs 3.916µs 3.920µs 3.924µs 0.32% -0.139 7.981 0.07% 0.000µs 1 200
credit_card/is_card_number/37828224631 throughput 254821647.278op/s 255627053.562op/s ± 185819.953op/s 255642807.388op/s ± 89292.572op/s 255721966.597op/s 255870283.462op/s 255930747.495op/s 256756508.341op/s 0.44% 0.161 8.060 0.07% 13139.455op/s 1 200
credit_card/is_card_number/378282246310005 execution_time 69.715µs 70.208µs ± 0.253µs 70.190µs ± 0.172µs 70.367µs 70.633µs 70.903µs 71.066µs 1.25% 0.615 0.387 0.36% 0.018µs 1 200
credit_card/is_card_number/378282246310005 throughput 14071378.099op/s 14243627.188op/s ± 51158.170op/s 14246994.060op/s ± 34761.701op/s 14278851.951op/s 14321766.800op/s 14331088.713op/s 14344122.521op/s 0.68% -0.594 0.343 0.36% 3617.429op/s 1 200
credit_card/is_card_number/37828224631000521389798 execution_time 52.117µs 52.187µs ± 0.029µs 52.183µs ± 0.016µs 52.202µs 52.241µs 52.271µs 52.301µs 0.23% 0.945 1.638 0.05% 0.002µs 1 200
credit_card/is_card_number/37828224631000521389798 throughput 19120220.878op/s 19161831.956op/s ± 10505.913op/s 19163395.997op/s ± 5702.657op/s 19168399.934op/s 19176889.739op/s 19180159.774op/s 19187512.767op/s 0.13% -0.941 1.626 0.05% 742.880op/s 1 200
credit_card/is_card_number/x371413321323331 execution_time 5.694µs 5.866µs ± 0.063µs 5.864µs ± 0.038µs 5.906µs 5.962µs 6.001µs 6.033µs 2.88% -0.109 -0.051 1.07% 0.004µs 1 200
credit_card/is_card_number/x371413321323331 throughput 165743624.880op/s 170485354.861op/s ± 1838075.826op/s 170518801.338op/s ± 1117818.847op/s 171612065.407op/s 173687669.533op/s 174908829.317op/s 175609935.171op/s 2.99% 0.171 -0.035 1.08% 129971.588op/s 1 200
credit_card/is_card_number_no_luhn/ execution_time 3.892µs 3.912µs ± 0.002µs 3.912µs ± 0.001µs 3.913µs 3.915µs 3.916µs 3.918µs 0.16% -2.387 19.432 0.06% 0.000µs 1 200
credit_card/is_card_number_no_luhn/ throughput 255254249.504op/s 255649978.715op/s ± 162672.447op/s 255656193.312op/s ± 87969.508op/s 255734287.575op/s 255844191.266op/s 255938302.924op/s 256961965.911op/s 0.51% 2.417 19.720 0.06% 11502.679op/s 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time 64.150µs 64.356µs ± 0.137µs 64.323µs ± 0.062µs 64.387µs 64.648µs 64.844µs 64.944µs 0.97% 1.806 3.615 0.21% 0.010µs 1 200
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput 15397783.983op/s 15538644.840op/s ± 32833.879op/s 15546567.228op/s ± 14924.306op/s 15560666.913op/s 15570972.905op/s 15578834.438op/s 15588484.786op/s 0.27% -1.791 3.549 0.21% 2321.706op/s 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time 57.386µs 57.563µs ± 0.110µs 57.550µs ± 0.070µs 57.618µs 57.743µs 57.923µs 57.964µs 0.72% 1.163 1.717 0.19% 0.008µs 1 200
credit_card/is_card_number_no_luhn/ 378282246310005 throughput 17252120.003op/s 17372356.850op/s ± 33013.067op/s 17376186.807op/s ± 21013.984op/s 17397312.116op/s 17414190.127op/s 17419201.661op/s 17425837.289op/s 0.29% -1.150 1.673 0.19% 2334.376op/s 1 200
credit_card/is_card_number_no_luhn/37828224631 execution_time 3.895µs 3.912µs ± 0.002µs 3.911µs ± 0.001µs 3.913µs 3.916µs 3.917µs 3.920µs 0.22% -1.031 10.300 0.06% 0.000µs 1 200
credit_card/is_card_number_no_luhn/37828224631 throughput 255128959.810op/s 255652759.649op/s ± 161526.974op/s 255681874.983op/s ± 80604.670op/s 255744573.768op/s 255839377.520op/s 255915846.530op/s 256763788.557op/s 0.42% 1.052 10.448 0.06% 11421.682op/s 1 200
credit_card/is_card_number_no_luhn/378282246310005 execution_time 54.503µs 54.831µs ± 0.224µs 54.769µs ± 0.116µs 54.947µs 55.231µs 55.524µs 55.681µs 1.67% 1.252 1.558 0.41% 0.016µs 1 200
credit_card/is_card_number_no_luhn/378282246310005 throughput 17959355.917op/s 18238287.637op/s ± 74281.313op/s 18258637.817op/s ± 38843.595op/s 18291058.887op/s 18322958.593op/s 18339324.779op/s 18347569.744op/s 0.49% -1.228 1.469 0.41% 5252.482op/s 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time 52.130µs 52.201µs ± 0.034µs 52.196µs ± 0.017µs 52.214µs 52.274µs 52.299µs 52.332µs 0.26% 0.958 1.461 0.06% 0.002µs 1 200
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput 19108864.094op/s 19156730.306op/s ± 12462.345op/s 19158549.520op/s ± 6200.594op/s 19164321.305op/s 19175083.417op/s 19180087.004op/s 19182697.207op/s 0.13% -0.953 1.449 0.06% 881.221op/s 1 200
credit_card/is_card_number_no_luhn/x371413321323331 execution_time 5.696µs 5.861µs ± 0.074µs 5.861µs ± 0.058µs 5.921µs 5.978µs 6.015µs 6.037µs 3.01% -0.003 -0.595 1.25% 0.005µs 1 200
credit_card/is_card_number_no_luhn/x371413321323331 throughput 165635844.063op/s 170646421.110op/s ± 2147078.987op/s 170619203.200op/s ± 1693072.736op/s 172257909.273op/s 174269845.894op/s 175335839.576op/s 175562646.896op/s 2.90% 0.056 -0.594 1.26% 151821.411op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
credit_card/is_card_number/ execution_time [3.911µs; 3.913µs] or [-0.024%; +0.024%] None None None
credit_card/is_card_number/ throughput [255534086.225op/s; 255657636.218op/s] or [-0.024%; +0.024%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 execution_time [79.976µs; 80.069µs] or [-0.058%; +0.058%] None None None
credit_card/is_card_number/ 3782-8224-6310-005 throughput [12489432.948op/s; 12504008.279op/s] or [-0.058%; +0.058%] None None None
credit_card/is_card_number/ 378282246310005 execution_time [73.406µs; 73.487µs] or [-0.055%; +0.055%] None None None
credit_card/is_card_number/ 378282246310005 throughput [13607981.609op/s; 13623012.099op/s] or [-0.055%; +0.055%] None None None
credit_card/is_card_number/37828224631 execution_time [3.912µs; 3.912µs] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/37828224631 throughput [255601300.703op/s; 255652806.420op/s] or [-0.010%; +0.010%] None None None
credit_card/is_card_number/378282246310005 execution_time [70.173µs; 70.243µs] or [-0.050%; +0.050%] None None None
credit_card/is_card_number/378282246310005 throughput [14236537.158op/s; 14250717.218op/s] or [-0.050%; +0.050%] None None None
credit_card/is_card_number/37828224631000521389798 execution_time [52.183µs; 52.191µs] or [-0.008%; +0.008%] None None None
credit_card/is_card_number/37828224631000521389798 throughput [19160375.938op/s; 19163287.974op/s] or [-0.008%; +0.008%] None None None
credit_card/is_card_number/x371413321323331 execution_time [5.858µs; 5.875µs] or [-0.149%; +0.149%] None None None
credit_card/is_card_number/x371413321323331 throughput [170230615.230op/s; 170740094.493op/s] or [-0.149%; +0.149%] None None None
credit_card/is_card_number_no_luhn/ execution_time [3.911µs; 3.912µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/ throughput [255627433.878op/s; 255672523.551op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 execution_time [64.337µs; 64.375µs] or [-0.029%; +0.029%] None None None
credit_card/is_card_number_no_luhn/ 3782-8224-6310-005 throughput [15534094.380op/s; 15543195.299op/s] or [-0.029%; +0.029%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 execution_time [57.548µs; 57.578µs] or [-0.026%; +0.026%] None None None
credit_card/is_card_number_no_luhn/ 378282246310005 throughput [17367781.557op/s; 17376932.144op/s] or [-0.026%; +0.026%] None None None
credit_card/is_card_number_no_luhn/37828224631 execution_time [3.911µs; 3.912µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/37828224631 throughput [255630373.564op/s; 255675145.734op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/378282246310005 execution_time [54.800µs; 54.862µs] or [-0.057%; +0.057%] None None None
credit_card/is_card_number_no_luhn/378282246310005 throughput [18227992.962op/s; 18248582.313op/s] or [-0.056%; +0.056%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 execution_time [52.196µs; 52.206µs] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/37828224631000521389798 throughput [19155003.145op/s; 19158457.468op/s] or [-0.009%; +0.009%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 execution_time [5.851µs; 5.871µs] or [-0.174%; +0.174%] None None None
credit_card/is_card_number_no_luhn/x371413321323331 throughput [170348856.612op/s; 170943985.608op/s] or [-0.174%; +0.174%] None None None

Group 12

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 7bac719 1773406731 vianney/implement-shared-runtime
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
benching serializing traces from their internal representation to msgpack execution_time 14.863ms 14.913ms ± 0.032ms 14.907ms ± 0.015ms 14.922ms 14.960ms 15.033ms 15.092ms 1.24% 2.482 8.680 0.21% 0.002ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
benching serializing traces from their internal representation to msgpack execution_time [14.908ms; 14.917ms] or [-0.030%; +0.030%] None None None

Group 13

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 7bac719 1773406731 vianney/implement-shared-runtime
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... execution_time 493.107µs 493.990µs ± 0.410µs 493.925µs ± 0.264µs 494.209µs 494.775µs 495.132µs 495.336µs 0.29% 0.813 0.547 0.08% 0.029µs 1 200
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput 2018829.850op/s 2024335.401op/s ± 1679.983op/s 2024597.055op/s ± 1081.556op/s 2025584.254op/s 2026424.257op/s 2027119.815op/s 2027956.736op/s 0.17% -0.809 0.537 0.08% 118.793op/s 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time 372.887µs 373.546µs ± 0.421µs 373.498µs ± 0.197µs 373.721µs 374.029µs 374.226µs 376.861µs 0.90% 4.174 29.084 0.11% 0.030µs 1 200
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput 2653500.688op/s 2677048.014op/s ± 3001.400op/s 2677388.483op/s ± 1411.079op/s 2678669.201op/s 2680533.088op/s 2681044.510op/s 2681778.215op/s 0.16% -4.128 28.634 0.11% 212.231op/s 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time 167.346µs 167.821µs ± 0.553µs 167.721µs ± 0.192µs 167.946µs 168.395µs 168.636µs 172.852µs 3.06% 6.483 53.295 0.33% 0.039µs 1 200
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput 5785305.432op/s 5958799.470op/s ± 19227.116op/s 5962269.373op/s ± 6829.850op/s 5968752.470op/s 5972501.188op/s 5974843.394op/s 5975628.330op/s 0.22% -6.353 51.752 0.32% 1359.562op/s 1 200
normalization/normalize_service/normalize_service/[empty string] execution_time 37.255µs 37.380µs ± 0.049µs 37.378µs ± 0.031µs 37.407µs 37.462µs 37.500µs 37.548µs 0.46% 0.331 0.359 0.13% 0.003µs 1 200
normalization/normalize_service/normalize_service/[empty string] throughput 26632827.310op/s 26752659.230op/s ± 34904.581op/s 26754027.484op/s ± 21874.362op/s 26775871.270op/s 26808716.280op/s 26823889.377op/s 26842335.542op/s 0.33% -0.322 0.347 0.13% 2468.127op/s 1 200
normalization/normalize_service/normalize_service/test_ASCII execution_time 45.563µs 45.682µs ± 0.045µs 45.683µs ± 0.026µs 45.707µs 45.753µs 45.782µs 45.876µs 0.42% 0.539 1.583 0.10% 0.003µs 1 200
normalization/normalize_service/normalize_service/test_ASCII throughput 21798007.475op/s 21890423.248op/s ± 21396.510op/s 21890120.071op/s ± 12465.706op/s 21903159.655op/s 21921901.600op/s 21934627.498op/s 21947819.413op/s 0.26% -0.530 1.556 0.10% 1512.962op/s 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... execution_time [493.933µs; 494.046µs] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/A0000000000000000000000000000000000000000000000000... throughput [2024102.572op/s; 2024568.231op/s] or [-0.012%; +0.012%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて execution_time [373.488µs; 373.605µs] or [-0.016%; +0.016%] None None None
normalization/normalize_service/normalize_service/Data🐨dog🐶 繋がっ⛰てて throughput [2676632.049op/s; 2677463.979op/s] or [-0.016%; +0.016%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters execution_time [167.744µs; 167.897µs] or [-0.046%; +0.046%] None None None
normalization/normalize_service/normalize_service/Test Conversion 0f Weird !@#$%^&**() Characters throughput [5956134.777op/s; 5961464.164op/s] or [-0.045%; +0.045%] None None None
normalization/normalize_service/normalize_service/[empty string] execution_time [37.373µs; 37.386µs] or [-0.018%; +0.018%] None None None
normalization/normalize_service/normalize_service/[empty string] throughput [26747821.790op/s; 26757496.669op/s] or [-0.018%; +0.018%] None None None
normalization/normalize_service/normalize_service/test_ASCII execution_time [45.676µs; 45.688µs] or [-0.014%; +0.014%] None None None
normalization/normalize_service/normalize_service/test_ASCII throughput [21887457.898op/s; 21893388.599op/s] or [-0.014%; +0.014%] None None None

Group 14

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 7bac719 1773406731 vianney/implement-shared-runtime
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
profile_add_sample2_frames_x1000 execution_time 736.813µs 738.336µs ± 0.722µs 738.294µs ± 0.429µs 738.741µs 739.354µs 740.065µs 742.726µs 0.60% 1.256 5.914 0.10% 0.051µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
profile_add_sample2_frames_x1000 execution_time [738.236µs; 738.436µs] or [-0.014%; +0.014%] None None None

Group 15

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 7bac719 1773406731 vianney/implement-shared-runtime
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
single_flag_killswitch/rules-based execution_time 189.906ns 192.208ns ± 1.695ns 192.011ns ± 1.190ns 193.164ns 195.600ns 196.683ns 197.285ns 2.75% 0.682 -0.074 0.88% 0.120ns 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
single_flag_killswitch/rules-based execution_time [191.973ns; 192.443ns] or [-0.122%; +0.122%] None None None

Group 16

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 7bac719 1773406731 vianney/implement-shared-runtime
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
sql/obfuscate_sql_string execution_time 85.488µs 85.636µs ± 0.254µs 85.604µs ± 0.043µs 85.656µs 85.743µs 85.836µs 89.050µs 4.03% 12.219 160.719 0.30% 0.018µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
sql/obfuscate_sql_string execution_time [85.600µs; 85.671µs] or [-0.041%; +0.041%] None None None

Group 17

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 7bac719 1773406731 vianney/implement-shared-runtime
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
two way interface execution_time 17.625µs 25.597µs ± 9.524µs 18.025µs ± 0.252µs 34.717µs 42.440µs 45.675µs 55.775µs 209.42% 0.698 -0.908 37.11% 0.673µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
two way interface execution_time [24.278µs; 26.917µs] or [-5.157%; +5.157%] None None None

Group 18

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 7bac719 1773406731 vianney/implement-shared-runtime
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
sdk_test_data/rules-based execution_time 144.887µs 146.591µs ± 1.588µs 146.355µs ± 0.475µs 146.843µs 148.193µs 153.652µs 161.978µs 10.67% 5.876 47.620 1.08% 0.112µs 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
sdk_test_data/rules-based execution_time [146.371µs; 146.811µs] or [-0.150%; +0.150%] None None None

Group 19

cpu_model git_commit_sha git_commit_date git_branch
Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz 7bac719 1773406731 vianney/implement-shared-runtime
scenario metric min mean ± sd median ± mad p75 p95 p99 max peak_to_median_ratio skewness kurtosis cv sem runs sample_size
receiver_entry_point/report/2598 execution_time 3.395ms 3.452ms ± 0.043ms 3.440ms ± 0.016ms 3.459ms 3.552ms 3.600ms 3.653ms 6.21% 2.015 4.284 1.25% 0.003ms 1 200
scenario metric 95% CI mean Shapiro-Wilk pvalue Ljung-Box pvalue (lag=1) Dip test pvalue
receiver_entry_point/report/2598 execution_time [3.446ms; 3.458ms] or [-0.174%; +0.174%] None None None

Baseline

Omitted due to size.

@github-actions
Copy link

github-actions bot commented Feb 20, 2026

📚 Documentation Check Results

⚠️ 1445 documentation warning(s) found

📦 libdd-common - 168 warning(s)

📦 libdd-data-pipeline - 799 warning(s)

📦 libdd-telemetry - 478 warning(s)


Updated: 2026-03-11 12:57:10 UTC | Commit: 85e0696 | missing-docs job results

@github-actions
Copy link

github-actions bot commented Feb 20, 2026

Clippy Allow Annotation Report

Comparing clippy allow annotations between branches:

  • Base Branch: origin/main
  • PR Branch: origin/vianney/implement-shared-runtime

Summary by Rule

Rule Base Branch PR Branch Change
unwrap_used 18 18 No change (0%)
Total 18 18 No change (0%)

Annotation Counts by File

File Base Branch PR Branch Change
libdd-data-pipeline/src/stats_exporter.rs 1 1 No change (0%)
libdd-data-pipeline/src/telemetry/mod.rs 1 1 No change (0%)
libdd-data-pipeline/src/trace_exporter/mod.rs 2 2 No change (0%)
libdd-telemetry/src/worker/mod.rs 13 13 No change (0%)
libdd-telemetry/src/worker/store.rs 1 1 No change (0%)

Annotation Stats by Crate

Crate Base Branch PR Branch Change
clippy-annotation-reporter 5 5 No change (0%)
datadog-ffe-ffi 1 1 No change (0%)
datadog-ipc 28 28 No change (0%)
datadog-live-debugger 6 6 No change (0%)
datadog-live-debugger-ffi 10 10 No change (0%)
datadog-profiling-replayer 4 4 No change (0%)
datadog-remote-config 3 3 No change (0%)
datadog-sidecar 59 59 No change (0%)
libdd-common 10 10 No change (0%)
libdd-common-ffi 12 12 No change (0%)
libdd-data-pipeline 5 5 No change (0%)
libdd-ddsketch 2 2 No change (0%)
libdd-dogstatsd-client 1 1 No change (0%)
libdd-profiling 13 13 No change (0%)
libdd-telemetry 19 19 No change (0%)
libdd-tinybytes 4 4 No change (0%)
libdd-trace-normalization 2 2 No change (0%)
libdd-trace-obfuscation 9 9 No change (0%)
libdd-trace-utils 15 15 No change (0%)
Total 208 208 No change (0%)

About This Report

This report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality.

@github-actions
Copy link

github-actions bot commented Feb 20, 2026

🔒 Cargo Deny Results

⚠️ 1 issue(s) found, showing only errors (advisories, bans, sources)

📦 libdd-common - ✅ No issues

📦 libdd-data-pipeline - 1 error(s)

Show output
error[vulnerability]: Denial of Service via Stack Exhaustion
    ┌─ /home/runner/work/libdatadog/libdatadog/Cargo.lock:293:1
    │
293 │ time 0.3.41 registry+https://github.com/rust-lang/crates.io-index
    │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ security vulnerability detected
    │
    ├ ID: RUSTSEC-2026-0009
    ├ Advisory: https://rustsec.org/advisories/RUSTSEC-2026-0009
    ├ ## Impact
      
      When user-provided input is provided to any type that parses with the RFC 2822 format, a denial of
      service attack via stack exhaustion is possible. The attack relies on formally deprecated and
      rarely-used features that are part of the RFC 2822 format used in a malicious manner. Ordinary,
      non-malicious input will never encounter this scenario.
      
      ## Patches
      
      A limit to the depth of recursion was added in v0.3.47. From this version, an error will be returned
      rather than exhausting the stack.
      
      ## Workarounds
      
      Limiting the length of user input is the simplest way to avoid stack exhaustion, as the amount of
      the stack consumed would be at most a factor of the length of the input.
    ├ Announcement: https://github.com/time-rs/time/blob/main/CHANGELOG.md#0347-2026-02-05
    ├ Solution: Upgrade to >=0.3.47 (try `cargo update -p time`)
    ├ time v0.3.41
      └── tracing-appender v0.2.3
          └── libdd-log v1.0.0
              └── (dev) libdd-data-pipeline v2.0.0

advisories FAILED, bans ok, sources ok

📦 libdd-telemetry - ✅ No issues


Updated: 2026-03-11 12:59:51 UTC | Commit: 85e0696 | dependency-check job results

@VianneyRuhlmann VianneyRuhlmann changed the title feat(worker): Add trigger to worker trait feat(runtime): add shared runtime Mar 9, 2026
@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented Mar 10, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 7bac719 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@VianneyRuhlmann VianneyRuhlmann marked this pull request as ready for review March 10, 2026 17:10
@VianneyRuhlmann VianneyRuhlmann requested review from a team as code owners March 10, 2026 17:10
///
/// # Errors
/// Returns an error if it fails to create a runtime.
pub fn runtime(&self) -> Result<Arc<Runtime>, io::Error> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is returning a single-threaded runtime ok?

When would the underlying runtime not be available? In between the before_fork() and after_fork_* functions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a component blocking function (e.g. TraceExporter::send) requires a tokio runtime while we are preparing for a fork, we want to allow the component to access one to avoid losing data (e.g. the trace payload) without restarting the full runtime which we would have to shutdown again. The components should use the runtime with block_on so a current thread runtime will behave in the same way as the multi-threaded one. Since the SharedRuntime doesn't hold a reference to this new runtime, it will be dropped when the blocking function returns guarantying no runtime is running across the fork.

}

#[derive(Debug)]
pub enum WorkerHandleError {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you impl std::error::Error for consistency with the other errors?

}

fn reset(&mut self) {
// Drain all messages from the channel to remove messages sent to release the reference on
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Drain all messages from the channel to remove messages sent to release the reference on
// Drain all messages from the channel to remove messages sent to release the reference on IoStack

/// Main worker loop
fn run(&mut self) -> impl std::future::Future<Output = ()> + Send;
/// # Lifecycle
/// The worker's `Self::run` method should be executed everytime the `Self::trigger` method returns.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defining a bunch of rules in comments that are not enforced in code is a bit of a smell. Do we anticipate there being more than PausableWorker and perhaps something that is WASM compatible? If there is a small number of impls, probably not a big deal because it looks like the rules are enforced internally in the impl, and not something the consumer has to deal with.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought of this comments to be aimed at people implementing the Worker trait, rather than for someone designing a Worker "runner" which for now is supposed to be only PausableWorker. Regarding WASM compatibility where using mostly std async stuff which should work the same, I'm not sure about the JoinHandle which are tokio specific but since node doesn't fork we may also provide an alternative implementation which doesn't support pausing the workers.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of these functions are using catch_panic. Is that intentional?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this live in libdd-data-pipeline? If we don't want a dedicated crate, shouldn't it go in libdd-common?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right I'll move it to ddcommon

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applies to the whole PR: Should we pepper in some debug log messages? Debugging this kind of stuff is tricky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants